package com.server.service;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
	

	public static void main(String[] args) {
		Socket socket;
		ServerSocket serverSocket;
		try {
			serverSocket=new ServerSocket(2468);
			while(true){
			System.out.println("正在监听用户连接");
			socket=serverSocket.accept();
			System.out.println("用户"+socket.getPort()+"连接进来了");
			
			ServerThread serverThread=new ServerThread(socket);
			serverThread.start();
			}
		} catch (IOException e) {
			System.exit(0);
			e.printStackTrace();
		} 

	}

}
